home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / MoreHardware / GluemachineHC.lha / Sources / SerLib / SerLib.s < prev   
Encoding:
Text File  |  1995-07-08  |  1.6 KB  |  55 lines

  1. **************************************************************
  2. *                           \|/                              *
  3. *                           @ @                              *
  4. *-----------------------ooO-(_)-Ooo--------------------------*
  5. *                                                            *
  6. *                      Serial library.                       *
  7. *                        Gluemaster                          *
  8. *                          950708                            *
  9. *                                                            *
  10. *------------------------------------------------------------*
  11. *                                                            *
  12. *                                                            *
  13. **************************************************************
  14.     PROCESSOR 68HC11
  15.  
  16.     XDEF InitSer
  17.     XDEF RecSer
  18.     XDEF TransSer
  19.  
  20.     include "ADEV11:include/hc11reg.i"
  21.  
  22.     RSEG CODE
  23.  
  24. ; Initialize to a:8:1:N where a is BAUDRATE in acc. a
  25. InitSer:
  26.     ldx #REGBASE
  27.     bclr SPCR,x,#DWOM
  28.     staa BAUD,x
  29.     ldaa #TE|RE
  30.     staa SCCR2,x
  31.     rts
  32.  
  33. ; Recieved byte in acc. a
  34. RecSer:
  35.     ldx #REGBASE
  36. RCLoop:
  37.     brclr SCSR,x,RDRF,RCLoop
  38.     ldaa SCDAT,x
  39.     rts
  40.  
  41. ; Byte to transmit in acc. a
  42. TransSer:
  43.     ldx #REGBASE
  44.     staa SCDAT,x
  45. WCLoop:
  46.     brclr SCSR,x,TDRE,WCLoop
  47.     rts
  48.  
  49. **************************************************************
  50. *                                                            *
  51. *-----------------------oooO---Oooo--------------------------*
  52. *                                                            *
  53. **************************************************************
  54.     END
  55.